//
//  UILabel+Extension.swift
//  CSYMicroBlockSina
//
//  Created by 姚彦兆 on 15/11/12.
//  Copyright © 2015年 姚彦兆. All rights reserved.
//

import UIKit

extension UILabel {


    convenience init(textInfo : String , fontSize : CGFloat , infoColor : UIColor = UIColor.blackColor() , numberOFLines : NSInteger , alphaValue : CGFloat , margin: CGFloat = 0.0){
        
        self.init()
        
        text = textInfo
        
        textAlignment = .Center
        
        if margin != 0 {
            
            preferredMaxLayoutWidth = screen_Width - 2 * margin
            
            textAlignment = .Left
            
        }
        
        font = UIFont.systemFontOfSize(fontSize)
        
        textColor = infoColor
        
        numberOfLines = numberOFLines
        
        alpha = alphaValue
        
        sizeToFit()
    
    }
    

}
